3.689 \(\int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx\)

Optimal. Leaf size=151 \[ \frac{a^3 (5 B+i A) (c-i c \tan (e+f x))^{n+2}}{c^2 f (n+2)}+\frac{4 a^3 (B+i A) (c-i c \tan (e+f x))^n}{f n}-\frac{4 a^3 (2 B+i A) (c-i c \tan (e+f x))^{n+1}}{c f (n+1)}-\frac{a^3 B (c-i c \tan (e+f x))^{n+3}}{c^3 f (n+3)} \]

[Out]

(4*a^3*(I*A + B)*(c - I*c*Tan[e + f*x])^n)/(f*n) - (4*a^3*(I*A + 2*B)*(c - I*c*Tan[e + f*x])^(1 + n))/(c*f*(1
+ n)) + (a^3*(I*A + 5*B)*(c - I*c*Tan[e + f*x])^(2 + n))/(c^2*f*(2 + n)) - (a^3*B*(c - I*c*Tan[e + f*x])^(3 +
n))/(c^3*f*(3 + n))

________________________________________________________________________________________

Rubi [A]  time = 0.190707, antiderivative size = 151, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.049, Rules used = {3588, 77} \[ \frac{a^3 (5 B+i A) (c-i c \tan (e+f x))^{n+2}}{c^2 f (n+2)}+\frac{4 a^3 (B+i A) (c-i c \tan (e+f x))^n}{f n}-\frac{4 a^3 (2 B+i A) (c-i c \tan (e+f x))^{n+1}}{c f (n+1)}-\frac{a^3 B (c-i c \tan (e+f x))^{n+3}}{c^3 f (n+3)} \]

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^n,x]

[Out]

(4*a^3*(I*A + B)*(c - I*c*Tan[e + f*x])^n)/(f*n) - (4*a^3*(I*A + 2*B)*(c - I*c*Tan[e + f*x])^(1 + n))/(c*f*(1
+ n)) + (a^3*(I*A + 5*B)*(c - I*c*Tan[e + f*x])^(2 + n))/(c^2*f*(2 + n)) - (a^3*B*(c - I*c*Tan[e + f*x])^(3 +
n))/(c^3*f*(3 + n))

Rule 3588

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(a*c)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rubi steps

\begin{align*} \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx &=\frac{(a c) \operatorname{Subst}\left (\int (a+i a x)^2 (A+B x) (c-i c x)^{-1+n} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(a c) \operatorname{Subst}\left (\int \left (4 a^2 (A-i B) (c-i c x)^{-1+n}-\frac{4 a^2 (A-2 i B) (c-i c x)^n}{c}+\frac{a^2 (A-5 i B) (c-i c x)^{1+n}}{c^2}+\frac{i a^2 B (c-i c x)^{2+n}}{c^3}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{4 a^3 (i A+B) (c-i c \tan (e+f x))^n}{f n}-\frac{4 a^3 (i A+2 B) (c-i c \tan (e+f x))^{1+n}}{c f (1+n)}+\frac{a^3 (i A+5 B) (c-i c \tan (e+f x))^{2+n}}{c^2 f (2+n)}-\frac{a^3 B (c-i c \tan (e+f x))^{3+n}}{c^3 f (3+n)}\\ \end{align*}

Mathematica [B]  time = 13.1288, size = 822, normalized size = 5.44 \[ \frac{\cos ^4(e+f x) \left (-\frac{i \sec (e) \left (B e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \cos (3 e)-i B e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \sin (3 e)\right ) \sin (f x) \sec ^3(e+f x)}{n+3}+\frac{\sec (e) (3 A \cos (e)-9 i B \cos (e)+A n \cos (e)-2 i B n \cos (e)+2 B \sin (e)+B n \sin (e)) \left (-i e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \cos (3 e)-e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \sin (3 e)\right ) \sec ^2(e+f x)}{(n+2) (n+3)}+\frac{\left (A n^2-i B n^2+6 A n-6 i B n+9 A-13 i B\right ) \sec (e) \left (2 i e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \sin (3 e)-2 e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \cos (3 e)\right ) \sin (f x) \sec (e+f x)}{(n+1) (n+2) (n+3)}+\frac{\sec (e) \left (i A \cos (e) n^3+B \cos (e) n^3-A \sin (e) n^3+i B \sin (e) n^3+6 i A \cos (e) n^2+6 B \cos (e) n^2-6 A \sin (e) n^2+6 i B \sin (e) n^2+13 i A \cos (e) n+9 B \cos (e) n-9 A \sin (e) n+13 i B \sin (e) n+12 i A \cos (e)+12 B \cos (e)\right ) \left (\frac{2 e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \cos (3 e)}{n}-\frac{2 i e^{n (i f x-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))-i f n x} \sin (3 e)}{n}\right )}{(n+1) (n+2) (n+3)}\right ) (i \tan (e+f x) a+a)^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^{n-\frac{n (\log (c-i c \tan (e+f x))-\log (c \sec (e+f x)))}{\log (c-i c \tan (e+f x))}}}{f (\cos (f x)+i \sin (f x))^3 (A \cos (e+f x)+B \sin (e+f x))} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^n,x]

[Out]

(Cos[e + f*x]^4*((Sec[e]*Sec[e + f*x]^2*(3*A*Cos[e] - (9*I)*B*Cos[e] + A*n*Cos[e] - (2*I)*B*n*Cos[e] + 2*B*Sin
[e] + B*n*Sin[e])*((-I)*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Cos[3*e]
- E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Sin[3*e]))/((2 + n)*(3 + n)) +
(Sec[e]*((12*I)*A*Cos[e] + 12*B*Cos[e] + (13*I)*A*n*Cos[e] + 9*B*n*Cos[e] + (6*I)*A*n^2*Cos[e] + 6*B*n^2*Cos[e
] + I*A*n^3*Cos[e] + B*n^3*Cos[e] - 9*A*n*Sin[e] + (13*I)*B*n*Sin[e] - 6*A*n^2*Sin[e] + (6*I)*B*n^2*Sin[e] - A
*n^3*Sin[e] + I*B*n^3*Sin[e])*((2*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))
*Cos[3*e])/n - ((2*I)*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Sin[3*e])/n
))/((1 + n)*(2 + n)*(3 + n)) + ((9*A - (13*I)*B + 6*A*n - (6*I)*B*n + A*n^2 - I*B*n^2)*Sec[e]*Sec[e + f*x]*(-2
*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Cos[3*e] + (2*I)*E^((-I)*f*n*x +
 n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Sin[3*e])*Sin[f*x])/((1 + n)*(2 + n)*(3 + n)) -
(I*Sec[e]*Sec[e + f*x]^3*(B*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Cos[3
*e] - I*B*E^((-I)*f*n*x + n*(I*f*x - Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Sin[3*e])*Sin[f*x])/(3
+ n))*(a + I*a*Tan[e + f*x])^3*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^(n - (n*(-Log[c*Sec[e + f*x]] + Log
[c - I*c*Tan[e + f*x]]))/Log[c - I*c*Tan[e + f*x]]))/(f*(Cos[f*x] + I*Sin[f*x])^3*(A*Cos[e + f*x] + B*Sin[e +
f*x]))

________________________________________________________________________________________

Maple [C]  time = 0.656, size = 4339, normalized size = 28.7 \begin{align*} \text{output too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x)

[Out]

4*a^3/(3+n)/f/(exp(2*I*(f*x+e))+1)^3/(1+n)/(2+n)/n*(-2*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*B*n*exp(1/2*I*Pi*csgn(
I*c/(exp(2*I*(f*x+e))+1))*n*(csgn(I*c/(exp(2*I*(f*x+e))+1))-csgn(I/(exp(2*I*(f*x+e))+1)))*(-csgn(I*c/(exp(2*I*
(f*x+e))+1))+csgn(I*c)))+2*I*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*n*A*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*
n*(csgn(I*c/(exp(2*I*(f*x+e))+1))-csgn(I/(exp(2*I*(f*x+e))+1)))*(-csgn(I*c/(exp(2*I*(f*x+e))+1))+csgn(I*c)))+6
*I*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*A*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*n*(csgn(I*c/(exp(2*I*(f*x+e)
)+1))-csgn(I/(exp(2*I*(f*x+e))+1)))*(-csgn(I*c/(exp(2*I*(f*x+e))+1))+csgn(I*c)))+11*2^n*c^n/((exp(2*I*(f*x+e))
+1)^n)*B*n*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csg
n(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c
/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(6*I*f*x)*exp(6*I*e)+18*I*2^n*c^n/((exp(2*
I*(f*x+e))+1)^n)*A*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1
))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*
csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(2*I*f*x)*exp(2*I*e)+18*I*2^n*c^n/
((exp(2*I*(f*x+e))+1)^n)*A*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f
*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1
/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(4*I*f*x)*exp(4*I*e)+6*I*2
^n*c^n/((exp(2*I*(f*x+e))+1)^n)*A*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp
(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)
*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(6*I*f*x)*exp(6*I*e
)+18*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*B*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*
c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+
1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(2*I*f*x)*exp
(2*I*e)+18*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*B*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*c
sgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*
x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(4*I*f*
x)*exp(4*I*e)+6*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*B*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I
*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*
I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(6
*I*f*x)*exp(6*I*e)+6*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*B*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*n*(csgn(I*
c/(exp(2*I*(f*x+e))+1))-csgn(I/(exp(2*I*(f*x+e))+1)))*(-csgn(I*c/(exp(2*I*(f*x+e))+1))+csgn(I*c)))-2*2^n*c^n/(
(exp(2*I*(f*x+e))+1)^n)*B*n^2*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I
*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp
(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(2*I*f*x)*exp(2*I*e)-2^
n*c^n/((exp(2*I*(f*x+e))+1)^n)*B*n^3*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(
exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))
*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(4*I*f*x)*exp(4*
I*e)+9*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*B*n*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csg
n(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+
e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(4*I*f*x)
*exp(4*I*e)-2*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*B*n^2*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2
*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(
2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp
(4*I*f*x)*exp(4*I*e)+I*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*A*n^3*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n
)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csg
n(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1
))*n)*exp(6*I*f*x)*exp(6*I*e)+2*I*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*A*n^2*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+
e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e)
)+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I
*(f*x+e))+1))*n)*exp(2*I*f*x)*exp(2*I*e)+12*I*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*n*A*exp(-1/2*I*Pi*csgn(I*c/(exp
(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2
*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(
I/(exp(2*I*(f*x+e))+1))*n)*exp(2*I*f*x)*exp(2*I*e)+8*I*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*A*n^2*exp(-1/2*I*Pi*cs
gn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn
(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn
(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(4*I*f*x)*exp(4*I*e)+21*I*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*n*A*exp(-1
/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2
*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e)
)+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(4*I*f*x)*exp(4*I*e)+11*I*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*
n*A*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*
n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2
*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(6*I*f*x)*exp(6*I*e)+6*I*2^n*c^n/((exp(2*I*(f*x+e
))+1)^n)*A*n^2*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2
*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*I*Pi*csgn
(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(6*I*f*x)*exp(6*I*e)+I*2^n*c^n/((exp(2
*I*(f*x+e))+1)^n)*A*n^3*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+
e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(-1/2*
I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(4*I*f*x)*exp(4*I*e)+2^n*c^n/
((exp(2*I*(f*x+e))+1)^n)*B*n^3*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*
I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+1))*n)*ex
p(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(6*I*f*x)*exp(6*I*e)+6
*2^n*c^n/((exp(2*I*(f*x+e))+1)^n)*B*n^2*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^3*n)*exp(1/2*I*Pi*csgn(I*
c/(exp(2*I*(f*x+e))+1))^2*csgn(I*c)*n)*exp(1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))^2*csgn(I/(exp(2*I*(f*x+e))+
1))*n)*exp(-1/2*I*Pi*csgn(I*c/(exp(2*I*(f*x+e))+1))*csgn(I*c)*csgn(I/(exp(2*I*(f*x+e))+1))*n)*exp(6*I*f*x)*exp
(6*I*e))

________________________________________________________________________________________

Maxima [B]  time = 2.70683, size = 1435, normalized size = 9.5 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x, algorithm="maxima")

[Out]

(((8*A + 8*I*B)*a^3*c^n*n^2 + 48*A*a^3*c^n*n + (72*A - 72*I*B)*a^3*c^n)*2^n*cos(-2*f*x + n*arctan2(sin(2*f*x +
 2*e), cos(2*f*x + 2*e) + 1) - 2*e) + ((4*A + 4*I*B)*a^3*c^n*n^3 + (32*A + 8*I*B)*a^3*c^n*n^2 + (84*A - 36*I*B
)*a^3*c^n*n + (72*A - 72*I*B)*a^3*c^n)*2^n*cos(-4*f*x + n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 4*
e) + ((4*A - 4*I*B)*a^3*c^n*n^3 + (24*A - 24*I*B)*a^3*c^n*n^2 + (44*A - 44*I*B)*a^3*c^n*n + (24*A - 24*I*B)*a^
3*c^n)*2^n*cos(-6*f*x + n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 6*e) + ((8*A + 8*I*B)*a^3*c^n*n +
(24*A - 24*I*B)*a^3*c^n)*2^n*cos(n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) - 8*((I*A - B)*a^3*c^n*n^2
 + 6*I*A*a^3*c^n*n + 9*(I*A + B)*a^3*c^n)*2^n*sin(-2*f*x + n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) -
 2*e) - 4*((I*A - B)*a^3*c^n*n^3 + 2*(4*I*A - B)*a^3*c^n*n^2 + 3*(7*I*A + 3*B)*a^3*c^n*n + 18*(I*A + B)*a^3*c^
n)*2^n*sin(-4*f*x + n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 4*e) - 4*((I*A + B)*a^3*c^n*n^3 + 6*(I
*A + B)*a^3*c^n*n^2 + 11*(I*A + B)*a^3*c^n*n + 6*(I*A + B)*a^3*c^n)*2^n*sin(-6*f*x + n*arctan2(sin(2*f*x + 2*e
), cos(2*f*x + 2*e) + 1) - 6*e) - 8*((I*A - B)*a^3*c^n*n + 3*(I*A + B)*a^3*c^n)*2^n*sin(n*arctan2(sin(2*f*x +
2*e), cos(2*f*x + 2*e) + 1)))/(((-I*n^4 - 6*I*n^3 - 11*I*n^2 - 6*I*n)*(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2
 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n)*cos(6*f*x + 6*e) + (-3*I*n^4 - 18*I*n^3 - 33*I*n^2 - 18*I*n)*(cos(2*f*x + 2
*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n)*cos(4*f*x + 4*e) + (n^4 + 6*n^3 + 11*n^2 + 6*n)*(
cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n)*sin(6*f*x + 6*e) + 3*(n^4 + 6*n^3 +
11*n^2 + 6*n)*(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n)*sin(4*f*x + 4*e) + (-
I*n^4 - 6*I*n^3 - 11*I*n^2 + (-3*I*n^4 - 18*I*n^3 - 33*I*n^2 - 18*I*n)*cos(2*f*x + 2*e) + 3*(n^4 + 6*n^3 + 11*
n^2 + 6*n)*sin(2*f*x + 2*e) - 6*I*n)*(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n
))*f)

________________________________________________________________________________________

Fricas [B]  time = 1.55552, size = 830, normalized size = 5.5 \begin{align*} \frac{{\left ({\left (8 i \, A - 8 \, B\right )} a^{3} n +{\left (24 i \, A + 24 \, B\right )} a^{3} +{\left ({\left (4 i \, A + 4 \, B\right )} a^{3} n^{3} +{\left (24 i \, A + 24 \, B\right )} a^{3} n^{2} +{\left (44 i \, A + 44 \, B\right )} a^{3} n +{\left (24 i \, A + 24 \, B\right )} a^{3}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} +{\left ({\left (4 i \, A - 4 \, B\right )} a^{3} n^{3} +{\left (32 i \, A - 8 \, B\right )} a^{3} n^{2} +{\left (84 i \, A + 36 \, B\right )} a^{3} n +{\left (72 i \, A + 72 \, B\right )} a^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} +{\left ({\left (8 i \, A - 8 \, B\right )} a^{3} n^{2} + 48 i \, A a^{3} n +{\left (72 i \, A + 72 \, B\right )} a^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \left (\frac{2 \, c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{n}}{f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n +{\left (f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \,{\left (f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \,{\left (f n^{4} + 6 \, f n^{3} + 11 \, f n^{2} + 6 \, f n\right )} e^{\left (2 i \, f x + 2 i \, e\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x, algorithm="fricas")

[Out]

((8*I*A - 8*B)*a^3*n + (24*I*A + 24*B)*a^3 + ((4*I*A + 4*B)*a^3*n^3 + (24*I*A + 24*B)*a^3*n^2 + (44*I*A + 44*B
)*a^3*n + (24*I*A + 24*B)*a^3)*e^(6*I*f*x + 6*I*e) + ((4*I*A - 4*B)*a^3*n^3 + (32*I*A - 8*B)*a^3*n^2 + (84*I*A
 + 36*B)*a^3*n + (72*I*A + 72*B)*a^3)*e^(4*I*f*x + 4*I*e) + ((8*I*A - 8*B)*a^3*n^2 + 48*I*A*a^3*n + (72*I*A +
72*B)*a^3)*e^(2*I*f*x + 2*I*e))*(2*c/(e^(2*I*f*x + 2*I*e) + 1))^n/(f*n^4 + 6*f*n^3 + 11*f*n^2 + 6*f*n + (f*n^4
 + 6*f*n^3 + 11*f*n^2 + 6*f*n)*e^(6*I*f*x + 6*I*e) + 3*(f*n^4 + 6*f*n^3 + 11*f*n^2 + 6*f*n)*e^(4*I*f*x + 4*I*e
) + 3*(f*n^4 + 6*f*n^3 + 11*f*n^2 + 6*f*n)*e^(2*I*f*x + 2*I*e))

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))**n,x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \tan \left (f x + e\right ) + A\right )}{\left (i \, a \tan \left (f x + e\right ) + a\right )}^{3}{\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^n,x, algorithm="giac")

[Out]

integrate((B*tan(f*x + e) + A)*(I*a*tan(f*x + e) + a)^3*(-I*c*tan(f*x + e) + c)^n, x)